﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class User_LendHistory : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Cancel_Click(object sender, EventArgs e)
    {
          
            if (Session["userName"] != null)
            {
                SqlDataSource1.SelectCommand = "declare @username varchar(50)" +
                "declare @bookID varchar(50)" +
                "declare @userID varchar(50)" +
                "declare @bookInfo varchar(2000)" +
                "select @userID=Reader_info.ReaderID from Reader_info where Reader_info.readerid=@name " +
                "select @bookID=Borrow_books_manage.BookID from Borrow_books_manage where Borrow_books_manage.UserID=UserID " +
                "select Book_info.BookID as 图书编号,Book_info.BookName as 图书条目,Book_info.FindBookNum as 索书号,Book_info.Writer as 作者,Book_info.BookPlace as 馆藏地点,Borrow_books_manage.LendBookDate as 借书日期," +
                "Borrow_books_manage.XUJIETIMES as 续借次数 from Book_info , Borrow_books_manage where Borrow_books_manage.readerID=@userID and Borrow_books_manage.bookid=Book_info.bookid and LendBookDate between @date1 and @date2";


                SqlDataSource1.SelectParameters["name"].DefaultValue = Session["userName"].ToString();
                SqlDataSource1.SelectParameters["date1"].DefaultValue = date1.Value.ToString();
                SqlDataSource1.SelectParameters["date2"].DefaultValue = date2.Value.ToString();
                
            }

    }
}